package demo2;
import java.sql.SQLOutput;
//画图形接口
interface IShape {
   /* int a =10;
    int aa = 10;
    public default void tsxt() {
        System.out.println("afsd");
    }
    public static void func() {
    }*/
    void draw();//接口中不能具体实现方法
}
class Cycle implements IShape{

    @Override
    public void draw() {
        System.out.println("画⭕");
    }
}
class Flower implements IShape {

    @Override
    public void draw() {
        System.out.println("画❀");
    }
}
class Heart implements IShape {

    @Override
    public void draw() {
        System.out.println("画♥");
    }
}
public class text1 {
    public static void func(IShape shape) {
        shape.draw();
    }
    public static void main(String[] ages) {
        //两种调用方法
        IShape ishape1 = new Flower();
        IShape ishape2 = new Cycle();
        IShape ishape3 = new Heart();
        ishape1.draw();
        ishape2.draw();
        ishape3.draw();

        func(new Heart());
        func(new Cycle());
        func(new Flower());

        IShape[] ishapes = {ishape1,ishape2,ishape3};//放在一个数组。
    }
}
